package com.industrial.operation.controller;

import com.industrial.common.core.web.domain.AjaxResult;
import com.industrial.operation.domain.BigPingCompanyEvaluateInfo;
import com.industrial.operation.service.IBigPingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 工业运行评价大屏
 * @author sangguangcan
 */
@RestController
@RequestMapping("/bigping")
public class BigPingController {

    @Autowired
    private IBigPingService bigPingService;

    /**
     * 查询工业企业统计
     * @return
     */
    @GetMapping("/queryCompanyStatistics")
    public AjaxResult queryCompanyStatistics(@RequestParam("years") String years){
        Map<String, String> result = bigPingService.queryCompanyStatistics(years);
        return AjaxResult.success(result);
    }

    /**
     * <p>
     *     查询城市的企业数量分布
     * </p>
     * @return
     */
    @GetMapping("/queryCityCompanyCount")
    public AjaxResult queryCityCompanyCount(@RequestParam("years") String years,@RequestParam("companyType") String companyType){
        List<Map<String,String>> result = bigPingService.queryCityCompanyCount(years,companyType);
        return AjaxResult.success(result);
    }

    /**
     * <p>
     *     查询工业经济分析
     * </p>
     * @return
     */
    @GetMapping("/queryIndustrialEconomicAnalysis")
    public AjaxResult queryIndustrialEconomicAnalysis(@RequestParam("years") String years){
        Map<String,Object> resultMap = bigPingService.queryIndustrialEconomicAnalysis(years);
        return AjaxResult.success(resultMap);
    }

    /***
     * 各地市工业增加值运行分析
     * @return
     */
    @GetMapping("/queryCityIndustrialOutput")
    public AjaxResult queryCityIndustrialOutput(@RequestParam("years") String years){
        Map<String, List<String>> resultMap = bigPingService.queryCityIndustrialOutput(years);
        return AjaxResult.success(resultMap);
    }

    /**
     * 工业季度报告
     * @return
     */
    @GetMapping("/queryGongYeJdBaoGao")
    public AjaxResult queryGongYeJdBaoGao(@RequestParam("years") String years){
        Map<String, String> result = bigPingService.queryGongYeJdBaoGao(years);
        return AjaxResult.success(result);
    }

    /**
     * 查询十强县
     * @return
     */
    @GetMapping("/queryShiQiangXian")
    public AjaxResult queryShiQiangXian(@RequestParam("years") String years){
        Map<String, Object> resultMap = bigPingService.queryShiQiangXian(years);
        return AjaxResult.success(resultMap);
    }

    /**
     * 查询开发区考核
     * @return
     */
    @GetMapping("/queryKfq")
    public AjaxResult queryKfq(@RequestParam("years") String years){
        Map<String, Object> resultMap = bigPingService.queryKfq(years);
        return AjaxResult.success(resultMap);
    }
}
